<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec"
           uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal"
                    scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

<%@ include file="/WEB-INF/include/header.jsp" %>
<%@ include file="/WEB-INF/include/submenu.jsp" %>

<div class="container-fluid ms-container has-ms-sidemenu">

  <ol class="ms-breadcrumb breadcrumb">
    <li class="active">财务报表&nbsp;-&nbsp;提现列表</li>
  </ol>

  <div class="ms-content-layout has-operation">
    <div class="x-operation-bar no-margin no-bottom-border clearfix">

      <ul class="nav nav-tabs ms-nav-tabs" role="tablist">
        <li role="presentation" class="${withdrawRecordPaidStatus.unpaid ? 'active' : ''}">
          <a href="${ctx.host}/withdraw-records?withdrawRecordPaidStatus=UNPAID">未打款</a>
        </li>
        <li role="presentation" class="${withdrawRecordPaidStatus.paid ? 'active' : ''}">
          <a href="${ctx.host}/withdraw-records?withdrawRecordPaidStatus=PAID">已打款</a>
        </li>
      </ul>

      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
        <div class="ms-operation-group">
          <div class="pull-right">
            <a href="${ctx.host}/withdraw-records/export" data-target="#export"
               data-toggle="modal" class="btn ms-btn ms-btn-blue"> <i
                    class="glyphicon glyphicon-save"></i>&nbsp;&nbsp;导出
            </a>
            <a href="${ctx.host}/withdraw-records/search?withdrawRecordPaidStatus=${withdrawRecordPaidStatus}" data-target="#search"
               data-toggle="modal" class="btn ms-btn ms-btn-blue"> <i
                    class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
            </a>
          </div>
        </div>
      </div>

      <table class="table table-hover ms-table">
        <thead>
        <tr>
          <th></th>
          <th>申请时间</th>
          <th>申请人</th>
          <th>电话</th>
          <th>email</th>
          <th>提现银行</th>
          <th>银行账户</th>
          <th>开户人姓名</th>
          <th>提现金额（RMB）</th>
          <th>账户余额</th>
          <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${withdrawRecords}" var="wd" varStatus="vs">
          <tr>
            <td>${vs.index + 1}</td>
            <td><fmt:formatDate value="${wd.createTime}" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate></td>
            <td>${wd.operator.name}  ${not empty wd.operator.company.companyName ? '-' += wd.operator.company.companyName : ''}</td>
            <td>${wd.operator.mobile}</td>
            <td>${wd.operator.email}</td>
            <td>${wd.operator.company.bankName}</td>
            <td>${wd.operator.company.bankAccount}</td>
            <td>${wd.operator.company.bankAccountName}</td>
            <td>¥ ${wd.cnyAmount}</td>
            <td>¥ ${wd.cnyCurrentUserWalletAmount}</td>

            <td>
              <a data-toggle="modal" data-target="#withdraw-record-confirm" href="${ctx.host}/withdraw-records/${wd.id}/confirm"> 标记打款 </a>
            </td>
          </tr>
        </c:forEach>
        </tbody>

        <tfoot>
        <tr>
          <td colspan="11" class="no-vertical-padding">
            <div class="pull-left">
              <jsp:include page="/WEB-INF/include/page.jsp">
                <jsp:param name="url" value="${ctx.host}/reports"/>
                <jsp:param name="queryString" value="${queryString}"/>
              </jsp:include>
            </div>
          </td>
        </tr>
        </tfoot>
      </table>


    </div>


  </div>
</div>
<%@ include file="/WEB-INF/include/footer.jsp" %>
<%@ include file="/WEB-INF/include/script.jsp" %>

<d:resource type="script" root="${ctx.resource}/build" src="js/page/report/withdraw-records-list.js"/>
<script type="text/javascript">
  require(['page/report/withdraw-records-list'], function (page) {
    page.init()
  })
</script>
</body>
</html>